/*import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/home',
      name: 'home',
      component: HomeView,
    },
    {
      path: '/about',
      name: 'about',
      component: () => import('../views/AboutView.vue'),
    },{
     // path: '/',
     // name: 'login',
    //  component: () => import('../views/loginView.vue'),
    }, {
      path: '/',
      name: 'main',
      component: () => import('../views/main.vue'),
      children: [
        {
          path: '/',
          name: 'home',
          component: () => import('../views/home.vue'),
        },
        {
          path: '/about',
          name: 'about',
          component: () => import('../views/about.vue'),
        },
        {
          path: '/login',
          name: 'login',
          component: () =>import('../views/loginView.vue'),
        }
      ]
    }
  ],
})

export default router*/
import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/main',
      name: 'main',
      component: () => import('../views/main.vue'),
      children: [
        {
          path: '/main/home',
          name: 'home',
          component: () => import('../views/HomeView.vue'),
        },
        {
          path: '/main/user',
          name: 'user',
          component: () => import('../views/userMain.vue'),
        },
        // 新增角色管理路由
        {
          path: '/main/role', // Added route for role management
          name: 'role',
          component: () => import('../views/role/roleMain.vue'), // New role management component
        },
        {
          path: '/main/org', // 新增部门管理路由
          name: 'org',
          component: () => import('../views/org/orgMain.vue'), // 新增部门管理组件
        },
      ],
    },
    {
      path: '/main/User',
      name: 'User',
      component: () => import('../views/UserRegist.vue'),
    },
    {
      path: '/',
      name: 'login',
      component: () => import('../views/loginView.vue'),
    },
  ],
})

export default router